import axios from '@/utils/myaxios.js'

export const getarticleList = (params) => {
  return axios({
    url: '/post',
    params
  })
}

// 文章详情
export const articleDetail = (id) => {
  return axios({
    url: '/post/' + id
  })
}

// 点赞
export const postlike = (id) => {
  return axios({
    url: '/post_like/' + id
  })
}

// 收藏
export const post_star = (id) => {
  return axios({
    url: '/post_star/' + id
  })
}

// 收藏文章列表
export const user_star = () => {
  return axios({
    url: '/user_star'
  })
}

// 评论列表
export const post_comment = (id) => {
  return axios({
    url: '/post_comment/' + id
  })
}

// 评论文章
export const sendpost_comment = (id, data) => {
  return axios({
    method: 'POST',
    url: '/post_comment/' + id,
    data
  })
}

// 搜索文章
export const search_article = (keywords) => {
  return axios({
    url: '/post_search?keyword=' + keywords
  })
}